/**
 * @author MyPC
 * @date 2018/6/28
 */

 public class InterceptingFilterDemo {
    public static void main(String[] args) {
        //整体逻辑:  客户端发送一个请求给中间端 ,中间端接受到请求之后,进行是否拦截的处理,
        Client client = new Client();
        FilterManager filterManager = FilterManager.getInstance();
        filterManager.setTarget(new Target());
        AuthenticationFilter authenticationFilter = new AuthenticationFilter();
        DebugFilter debugFilter = new DebugFilter();
        filterManager.filterChain.addFilter(authenticationFilter);
        filterManager.filterChain.addFilter(debugFilter);
        client.setFilterManager(filterManager);
        client.sendRequest("HOME");
    }
}
